#include <iostream>
#include <cmath>
#include <vector>
#include <fstream>
using namespace std;

class Point {
public:
    double x, y;
};

int fact(int n) {
    if (n == 0) {
        return 1;
    } else {
        int result = 1;
        for (int i = n; i > 0; i--) {
            result *= i;
        }
        return result;
    }
}

void bezier_point(Point* pm, int m, ofstream& out) {
    int n = m - 1;
    for (double t = 0; t <= 1; t += 0.001) {
        double Bt = 0;
        double Xt = 0;
        double Yt = 0;
        for (int i = 0; i <= n; i++) {
            Bt = fact(n) / (fact(n - i) * fact(i)) * pow((1 - t), (n - i)) * pow(t, i);
            Xt += Bt * (pm[i].x);
            Yt += Bt * (pm[i].y);
        }
        out << Xt << " " << Yt << endl;
    }
}
